{{template "base/head" .}}
<div class="user settings organizations">
	<div class="ui container">
		<div class="ui grid">
			{{template "user/settings/navbar" .}}
			<div class="twelve wide column content">
				{{template "base/alert" .}}
				<h4 class="ui top attached header">
					{{.i18n.Tr "settings.orgs"}}
					<div class="ui right">
						<a class="ui blue tiny button" href="{{AppSubURL}}/org/create">{{.i18n.Tr "new_org"}}</a>
					</div>
				</h4>
				<div class="ui attached segment orgs {{if .Orgs}}non-empty{{end}}">
					{{if .Orgs}}
						<div class="ui middle aligned divided list">
							{{range .Orgs}}
							<div class="item">
								<div class="right floated">
									<button class="ui red tiny basic button inline delete-button" data-url="{{$.Link}}/leave" data-id="{{.ID}}">
										{{$.i18n.Tr "org.members.leave"}}
									</button>
								</div>
								<img class="ui mini image" src="{{.RelAvatarLink}}">
								<div class="content">
									<a href="{{.HomeLink}}">{{.Name}}</a>
								</div>
							</div>
							{{end}}
						</div>
					{{else}}
						{{.i18n.Tr "settings.orgs.none"}}
					{{end}}
				</div>
			</div>
		</div>
	</div>
</div>

<div class="ui small basic delete modal">
	<div class="ui icon header">
		<i class="trash icon"></i>
		{{.i18n.Tr "settings.orgs.leave_title"}}
	</div>
	<div class="content">
		<p>{{.i18n.Tr "settings.orgs.leave_desc"}}</p>
	</div>
	{{template "base/delete_modal_actions" .}}
</div>
{{template "base/footer" .}}
